import { request } from "@/utils/request";

const prefixUser = '/ht-user'
const prefixNormal = '/ht-nonrealtime-gameservice'
/**
 * 获取企业全部的荣耀列表
 * @param enterpriseName 企业名称
 * @returns {Promise<unknown>}
 */
export const getEnterpriseAllHonorListApi = enterpriseName => {
    return request({
        url: `${prefixNormal}/honorScore/getEnterpriseHasHonorList?enterpriseName=${enterpriseName}`,
        method: 'GET'
    })
}

/**
 * 获取企业信息详情
 * @param enterpriseId 企业id
 * @returns {Promise | Promise<unknown>}
 */
export const getEnterpriseAllInfoApi = enterpriseId => {
    return request({
        url: `${prefixUser}/enterprise/getAppEnterpriseById?enterpriseId=${enterpriseId}`,
        method: 'GET'
    })
}

/**
 * 获取企业荣誉列表
 * @returns {Promise<unknown>}
 */
export const getEnterpriseHonorMapApi = () => {
    return request({
        url: `${prefixUser}/enterprise/getEnterpriseHonorCountKeyList`,
        method: 'GET'
    })
}

/**
 * 获取雷达图数据
 * @param enterpriseName 企业名称
 * @returns {Promise<unknown>}
 */
export const getEnterPriseHonorRadarChartDataApi = enterpriseName => {
    return request({
        url: `${prefixNormal}/honorScore/getEnterpriseHonorScore`,
        method: 'POST',
        type: 'application/x-www-form-urlencoded',
        data: {enterpriseName}
    })
}

export const getEnterpriseBadgeDetailApi = enterpriseName => {
    return request({
        url: `${prefixNormal}/badge/getEnterpriseBadgeDetail?enterpriseName=${enterpriseName}`,
        method: 'GET'
    })
}
// 个人详情
export const getUserInfoByIdApi = id => {
    return request({
        url: `/ht-user/basic/getUserInfoById?userId=${id}`,
        method: 'GET'
    })
}
// 个人徽章
export const getUserBadgeDetailApi = id => {
    return request({
        url: `/ht-nonrealtime-gameservice/badge/getUserBadgeDetail?userId=${id}`,
        method: 'POST'
    })
}
// 个人雷达图
export const getUserHonorScoreApi = id => {
    return request({
        url: `/ht-nonrealtime-gameservice/honorScore/getUserHonorScore?userId=${id}`,
        method: 'GET'
    })
}
// 个人标签分类
export const getUserHasHonorListApi = id => {
    return request({
        url: `/ht-nonrealtime-gameservice/honorScore/getUserHasHonorList?userId=${id}`,
        method: 'GET'
    })
}